/**
 * 
 */
package com.adkfp.action;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.adkfp.bean.ADKManageUserBean;
import com.adkfp.common.Constant;
import com.adkfp.service.IADKManagePageService;
import com.adkfp.utils.MyUtils;

/**
 * 首页
 */
@Controller
@RequestMapping(value="index")
public class IndexAction {
	@Resource(name="aDKManagePageService")
	private IADKManagePageService aDKManagePageService;
	/**
	 * 跳转到首页
	 */
	@RequestMapping(value="toIndexPage")
	public String toIndexPage(HttpServletRequest request, HttpServletResponse response){
		HttpSession session = request.getSession();
		Integer userId = (Integer) session.getAttribute(Constant.SESSION_USERID_LONG);
		String localIp = MyUtils.getLocalIp();
		//System.out.println("localIp:"+localIp);
		//获取可以查看的页面
		Integer role=(Integer)session.getAttribute(Constant.SESSION_USERID_ROLE);
		//System.out.println("role:"+role);
		ADKManageUserBean bean = (ADKManageUserBean) request.getSession().getAttribute(Constant.SESSION_USER_BEAN);
		request.setAttribute("realName", bean.getRealName());
		request.setAttribute("localIp", localIp);
		request.setAttribute("u",bean.getRoleIdList().get(0));
		return "index/index";
		//return "index/indexNew";
	}
	
}
